import Taro, { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import './eyephoto.css'
import { AtSteps,AtImagePicker,AtButton } from 'taro-ui'
import {$redirectTo} from '../../../global'
import app from '../../../main.js'
export default class EyePhoto extends Component {

  config = {
    navigationBarTitleText: '快速问诊'
  }
  constructor () {
    super(...arguments)
    this.state = {
      current: 4,
      files: [],
      files2: [],
      files3: [],
      files4: []
    }
  }
  onChange (current) {
    
    this.setState({
      current
    })
    
  }

  onChange1(files){
    this.setState({
      files
    })
  }
  onChange2 (files2) {
    this.setState({
      files2
    })
  }
  onChange3 (files3) {
    this.setState({
      files3
    })
  }
  onChange4 (files4) {
    this.setState({
      files4
    })
  }
wenti=()=>{
  app.redirectTo("../illhistory/illhistory")
}
  componentWillMount () { }

  componentDidMount () { }

  componentWillUnmount () { }

  componentDidShow () { }

  componentDidHide () { }

  render () {
    const items = [
        { 'title': '' },
        { 'title': '' },
        { 'title': '' },
        { 'title': '' },
        { 'title': '' },
        { 'title': '' },
        { 'title': '' },
        { 'title': '' }
      ];
    return (
      <View className='eye-photo'>
      <AtSteps
        className='steps'
        items={items}
        current={this.state.current}
        onChange={this.onChange.bind(this)}
      />
       <View className='title'>拍摄眼睛照片和视频照片</View>
       <View className='tips-two'>*照片必须上传，视频可以选择性上传</View>
       <View className='box'>
       <View className='tips'>
      左眼照片
      </View>
       <AtImagePicker
        files={this.state.files}
        onChange={this.onChange1.bind(this)}
      />
       </View>
       <View className='box'>
       <View className='tips'>
      右眼照片
      </View>
       <AtImagePicker
        files={this.state.files2}
        onChange={this.onChange2.bind(this)}
      />
       </View>
       <View className='box'>
       <View className='tips'>
      全脸照片
      </View>
       <AtImagePicker
        files={this.state.files3}
        onChange={this.onChange3.bind(this)}
      />
       </View>
       <View className='box'>
       <View className='tips'>
      视频
      </View>
       <AtImagePicker
        files={this.state.files4}
        onChange={this.onChange4.bind(this)}
      />
       </View>
       <View className='blank-box'></View>
      <View className='btn-box' ><AtButton className='next-btn' onClick={this.wenti} full>下一步</AtButton></View>
      </View>
    )
  }
}

